The present invention generally relates to computer networks, and, more particularly, to a data transmission system in a computer network.
A computer network is a group of computing devices interconnected by a transmission medium. The computer network facilitates exchange of information between the computing devices. The computer network includes two types of the computing devices, namely, client devices and servers. Servers contain multiple resources that are shared with other computing devices in the computer network, such as data files that store information that is exchanged between the computing devices. The client devices access the resources provided by the servers.
A server has a memory that stores data files to be transmitted and boot code for booting a server operating system (OS), examples of which include Linux©, Windows©, and Macintosh© OSs. The memory includes multiple physical addresses at which the data files and the boot code are stored. For example, the boot code may be stored in a secure partition of the memory that cannot be overwritten. The server also includes a processor that retrieves the boot code from the memory and then executes it.
The server OS enables execution of multiple user processes. These user processes provide multiple services to a client device connected to the server, such as a file transfer service for transmitting data files, e-mail, and a web browser. The server OS further enables execution of a kernel that acts as an interface between the user processes and the processor and the memory, where the processor controls access of the user processes to the memory by way of the kernel.
To provide access to the physical addresses of the memory, the server OS utilizes a virtual address space that includes multiple virtual addresses that correspond to the physical addresses. To protect data files from malicious programs that may affect user processes and to provide fault tolerance during processing, the virtual address space is divided into two spaces, a kernel space that includes a first set of virtual addresses, and a user space that includes a second set of virtual addresses. The data files are stored at the physical addresses corresponding to the kernel space. The kernel space is reserved for kernel services and system calls generated by the kernel. The user space is reserved for user processes. The user processes request a kernel service using a system call. When the processor executes a system call, the processor is in a kernel mode. When the processor executes user processes, the processor is in a user mode. Therefore, when user processes such as file transfer services are executed, the data files are transmitted from the kernel space of the server to the client device via the computer network.
FIG. 1A illustrates a schematic block diagram of a conventional server 102 for transmitting a data file to a client device (not shown) in a computer network (not shown) by generating read and write system calls. The server 102 includes a processor 104, a memory 106, and a network interface device 108. The processor 104 includes a system memory 110, and the network interface device 108 includes a direct memory access (DMA) system 112. The memory 106 has a user space 114 and a kernel space 116. The kernel space 116 includes a kernel buffer 118 and a socket 120, and the user space 114 includes a user buffer 122.
The processor 104, the memory 106, and the network interface device 108 are interconnected with a system bus (not shown). The DMA system 112 is connected to the client device via the computer network for transmitting the data file.
Initially, the processor 104 operates in a user mode and executes a file transfer service, where the server 102 receives a transmission request from the client device. In response, the processor 104 identifies the data file stored in a secondary memory (not shown) of the server 102, retrieves the data file from the secondary memory, and stores the data file in to the kernel buffer 118. Subsequently, the file transfer service generates a read system call. The processor 104 then transitions from the user mode to the kernel mode to execute the read system call. The processor 104 copies the content of the kernel buffer 118 to the user buffer 122 based on the read system call. The processor 104 then transitions from the kernel mode and to the user mode. To initiate transmission of the data file by way of the DMA system 112, the file transfer service generates a write system call to store the data file in the socket 120. The processor 104 then transitions from the user mode to the kernel mode to execute the write system call. The processor 104 copies the content of the user buffer 122 to the socket 120 based on the write system call. The DMA system 112 retrieves the data file from the socket 120 and transmits it to the client device via the computer network.
FIG. 1B illustrates transitions of the processor 104 between the user and kernel modes when the processor 104 generates read and write system calls. Here, the processor 104 undergoes transitions between the user and kernel modes four times during the transmission of the data file by executing read and write system calls.
FIG. 2A is a schematic block diagram of another conventional server 202 that can transmit a data file to a client device (not shown) in a computer network (not shown) using a SENDFILE system call. The server 202 includes a processor 204, a memory 206, and a network interface device 208. The processor 204 includes a system memory 210. The network interface device 208 includes a direct memory access (DMA) system 212. The memory 106 has a user space 214 and a kernel space 216, and the kernel space 216 includes a kernel buffer 218 and a socket 220.
The processor 204, the memory 206, and the network interface device 208 are interconnected by a system bus (not shown). The DMA system 212 is connected to the client device via the computer network for transmitting the data file.
Initially, the processor 204 operates in a user mode and executes a file transfer service. The server 202 receives a transmission request from the client device via the computer network for transmitting the data file. In response, the processor 204 identifies the data file stored in a secondary memory (not shown) of the server 202, retrieves the data file from the secondary memory, and stores it in the kernel buffer 218. Subsequently, the file transfer service generates the SENDFILE system call. The processor 204 then transitions from the user mode to the kernel mode to execute the SENDFILE system call. The processor 204 copies the contents of the kernel buffer 218 to the socket 220 based on the SENDFILE system call, and then transitions from the kernel mode back to the user mode. The DMA system 212 retrieves the data file from the socket 220 and transmits it to the client device via the computer network.
FIG. 2B illustrates transitions of the processor 204 between the user and kernel modes when the processor 204 generates the SENDFILE system call. Here, the processor 204 undergoes transitions between the user and kernel modes just two times by using the SENDFILE system call.
FIG. 3A is a schematic block diagram of yet another conventional server 302 for transmitting a data file to a client device (not shown) in a computer network (not shown) by generating memory map and write system calls. The memory map system call is also referred to as an MMAP system call. The server 302 includes a processor 304, a memory 306, and a network interface device 308. The processor 304 includes a system memory 310. The network interface device 308 includes a direct memory access (DMA) system 312. The memory 306 includes a user space 314 and a kernel space 316, and the kernel space 316 includes a kernel buffer 318 and a socket 320, while the user space 314 has a user buffer 322.
The processor 304, memory 306, and network interface device 308 are interconnected with a system bus (not shown). The DMA system 312 is connected to the client device via the computer network.
Initially, the processor 304 operates in a user mode and executes a file transfer service, and the server 302 then receives a transmission request from the client device. In response to the transmission request, the processor 304 identifies the data file stored in a secondary memory (not shown) of the server 302, retrieves the data file from the secondary memory, and stores it in the kernel buffer 318. Subsequently, the file transfer service generates the MMAP system call. The processor 304 then transitions from the user mode to kernel mode to execute the MMAP system call. The processor 304 stores a set of virtual addresses corresponding to the data file in to the user buffer 322 based on the MMAP system call. The processor 304 then transitions from the kernel mode back to the user mode. To initiate transmission of the data file using the DMA system 312, the file transfer service generates a write system call to store the data file in the socket 320. The processor 304 then transitions from the user mode to the kernel mode to execute the write system call. The processor 304 copies the content of the user buffer 322 to the socket 320 based on the write system call, thereby storing the set of virtual addresses in the socket 320. The DMA system 312 receives the virtual addresses from the socket 320 and determines a set of corresponding physical addresses by referring to a translation look-aside buffer (TLB) (not shown) stored in the system memory 310. The TLB is a cache memory used to translate a virtual address into a corresponding physical address. The DMA system 312 then retrieves the data file from the kernel buffer 318 based on the set of physical addresses and transmits the data file to the client device via the computer network.
FIG. 3B illustrates transitions of the processor 304 between the user and kernel modes when the processor 304 generates the MMAP and write system calls. Here, the processor 304 undergoes four transitions between the user and kernel modes during the transmission of the data file by executing the MMAP and write system calls.
In the aforementioned conventional systems for transmitting the data file, one or more than one copies of the data file are created in the memory. A large number of server processing cycles are used for creating the data file copies within the server. The efficiency of the server is directly dependent on the number of processing cycles available for performing user processes. When the server uses a large number of processing cycles for creating data file copies, the number of processing cycles available for user processes is reduced, thereby resulting in reduced performance. Further, the data file copies consume large spaces in the memory. Since the server operates on a finite physical memory size, the large spaces occupied by the data file copies cause a reduction in the memory available for other user processes, thus also affecting server performance.
The above-described methods cause the processor to transition between the user and kernel modes multiple times. A large number of processing cycles are wasted by these transitions. The use of the TLB to execute the SENDFILE system call may result in a TLB miss, which is when a requested virtual address is not present in the TLB. Hence, the conventional data transmission systems discussed above suffer from inefficiency and it would be advantageous to have a more efficient data transmission system and/or one that requires less memory space.